//
// Created by wxd on 2025/9/11.
//

#pragma once

#ifndef PARALLELLIGHT_H
#define PARALLELLIGHT_H

#include "Light.h"
#include "glm/glm.hpp"
#include <string>

class ParallelLight : public Light {
public:
    static std::string uParallelLightColor;
    static std::string uParallelLightDirection;
    static std::string uParallelLightIntensity;

    explicit ParallelLight(const glm::vec3& direction = glm::vec3(0.0f, -1.0f, 0.0f),
                           const glm::vec3& color = glm::vec3(1.0f),
                           const glm::vec3& intensity = glm::vec3(1.f),
                           const std::string& name = "ParallelLight")
        : Light(LightType::Parallel, color, intensity, name)
        , mDirection(glm::normalize(direction)) {}

    // ILight 接口实现
    LightType getType() const override { return LightType::Parallel; }

    std::unique_ptr<ILight> clone() const override {
        return std::make_unique<ParallelLight>(*this);
    }

    // 平行光特有方法
    glm::vec3 getDirection() const;

    void setDirection(const glm::vec3& direction);

private:
    glm::vec3 mDirection;
};
#endif //PARALLELLIGHT_H
